<HTML>
<HEAD>
<TITLE>[Chapter 19] Color</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:10:14 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch19_13.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 19<br>java.awt Reference</FONT></B></TD>
<td width=172 align=right valign=top>&nbsp;</td>
<td width=172 align=right valign=top><A HREF="ch19_15.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>Color</H1>

<H2>Name</H2>

Color

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch19-REFSECT1-AUTOID.14"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/color.gif" alt="[Graphic: Figure from the text]" width=502 height=71 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-1">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>Color</tt> class represents 
a specific color to the system. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-2">Class Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public final class java.awt.Color
    extends java.lang.Object
    implements java.io.Serializable {
  
  // Constants
  public static final Color black;
  public static final Color blue;
  public static final Color cyan;
  public static final Color darkGray;
  public static final Color gray;
  public static final Color green;
  public static final Color lightGray;
  public static final Color magenta;
  public static final Color orange;
  public static final Color pink;
  public static final Color red;
  public static final Color white;
  public static final Color yellow;
  
  // Constructors
  public Color (int rgb);
  public Color (int red, int green, int blue);
  public Color (float red, float green, float blue);
  
  // Class Methods
  public static Color decode (String name); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public static Color getColor (String name);
  public static Color getColor (String name, Color defaultColor);
  public static Color getColor (String name, int defaultColor);
  public static Color getHSBColor (float hue, float saturation, 
      float brightness);
  public static int HSBtoRGB (float hue, float saturation, float brightness);
  public static float[] RGBtoHSB (int red, int green, int blue, 
      float hsbvalues[]);
  
  // Instance Methods
  public Color brighter();
  public Color darker();
  public boolean equals (Object object);
  public int getBlue();
  public int getGreen();
  public int getRed();
  public int getRGB();
  public int hashCode();
  public String toString();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3">Constants</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.1">black</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.1.1">public static final Color black</A></h4>

<P CLASS=para>
The color black. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.2">blue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.2.1">public static final Color blue</A></h4>

<P CLASS=para>
The color blue. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.3">cyan</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.3.1">public static final Color cyan</A></h4>

<P CLASS=para>
The color cyan. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.4">darkGray</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.4.1">public static final Color darkGray</A></h4>

<P CLASS=para>
The color dark gray. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.5">gray</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.5.1">public static final Color gray</A></h4>

<P CLASS=para>
The color gray. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.6">green</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.6.1">public static final Color green</A></h4>

<P CLASS=para>
The color green. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.7">lightGray</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.7.1">public static final Color lightGray</A></h4>

<P CLASS=para>
The color light gray. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.8">magenta</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.8.1">public static final Color magenta</A></h4>

<P CLASS=para>
The color magenta. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.9">orange</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.9.1">public static final Color orange</A></h4>

<P CLASS=para>
The color orange. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.10">pink</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.10.1">public static final Color pink</A></h4>

<P CLASS=para>
The color pink. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.11">red</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.11.1">public static final Color red</A></h4>

<P CLASS=para>
The color red. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.12">white</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.12.1">public static final Color white</A></h4>

<P CLASS=para>
The color white. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.13">yellow</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-3.13.1">public static final Color yellow</A></h4>

<P CLASS=para>
The color yellow. 

</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-4">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-4.1">Color</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-4.1.1">public Color (int rgb)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>rgb</I><br>
<DD>

<P CLASS=para>
Composite color value </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Color</tt> object with 
the given <tt CLASS=literal>rgb</tt> value. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-4.1.2">public Color (int red, int green, int blue)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red component of color in the range[0, 255] 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green component of color in the range[0, 255] 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue component of color in the range[0, 255] </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Color</tt> object with 
the given <tt CLASS=literal>red</tt>, <tt CLASS=literal>green</tt>, 
and <tt CLASS=literal>blue</tt> values. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-4.1.3">public Color (float red, float green, float blue)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red component of color in the range[0.0, 1.0] 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green component of color in the range[0.0, 1.0] 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue component of color in the range[0.0, 1.0] </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Color</tt> object with 
the given <tt CLASS=literal>red</tt>, <tt CLASS=literal>green</tt>, 
and <tt CLASS=literal>blue</tt> values. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5">Class Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.1">decode</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.1.1">public static Color decode (String nm) <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>nm</I><br>
<DD>

<P CLASS=para>
A <tt CLASS=literal>String</tt> 
representing a color as a 24-bit integer. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The color requested. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>nm</tt> cannot be converted to a number. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets color specified by the given string. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.2">getColor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.2.1">public static Color getColor (String name)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>name</I><br>
<DD>

<P CLASS=para>
The name of a system 
property indicating which color to fetch. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Color instance of <tt CLASS=literal>name</tt> requested, 
or <tt CLASS=literal>null</tt> if the <tt CLASS=literal>name</tt> 
is invalid. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets color specified by the system property name.</DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.2.2">public static Color getColor (String name, Color defaultColor)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>name</I><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>name</tt> 
of a system property indicating which color to fetch. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>defaultColor</I><br>
<DD>

<P CLASS=para>
Color to return 
if <tt CLASS=literal>name</tt> is not found in properties, 
or invalid. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Color instance of <tt CLASS=literal>name</tt> requested, 
or <tt CLASS=literal>defaultColor</tt> if the <tt CLASS=literal>name</tt> 
is invalid. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets color specified by the system property <tt CLASS=literal>name</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.2.3">public static Color getColor (String name, int defaultColor)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>name</I><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>name</tt> 
of a system property indicating which color to fetch. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>defaultColor</I><br>
<DD>

<P CLASS=para>
Color to return 
if <tt CLASS=literal>name</tt> is not found in properties, 
or invalid. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Color instance of <tt CLASS=literal>name</tt> requested, 
or <tt CLASS=literal>defaultColor</tt> if the <tt CLASS=literal>name</tt> 
is invalid. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets color specified by the system property <tt CLASS=literal>name</tt>. 
The default color is specified as a 32-bit RGB value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.3">getHSBColor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.3.1">public static Color getHSBColor (float hue, float saturation, float brightness)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>hue</I><br>
<DD>

<P CLASS=para>
Hue component of <tt CLASS=literal>Color</tt> 
to create, in the range[0.0, 1.0]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>saturation</I><br>
<DD>

<P CLASS=para>
Saturation component 
of <tt CLASS=literal>Color</tt> to create, in the 
range[0.0, 1.0]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>brightness</I><br>
<DD>

<P CLASS=para>
Brightness component 
of <tt CLASS=literal>Color</tt> to create, in the 
range[0.0, 1.0]. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Color instance for values provided. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Create an instance of <tt CLASS=literal>Color</tt> 
by using hue, saturation, and brightness instead of red, green, and blue 
values. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.4">HSBtoRGB</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.4.1">public static int HSBtoRGB (float hue, float saturation, float brightness)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>hue</I><br>
<DD>

<P CLASS=para>
Hue component of <tt CLASS=literal>Color</tt> 
to convert, in the range[0.0, 1.0]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>saturation</I><br>
<DD>

<P CLASS=para>
Saturation component 
of <tt CLASS=literal>Color</tt> to convert, in the 
range[0.0, 1.0]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>brightness</I><br>
<DD>

<P CLASS=para>
Brightness component 
of <tt CLASS=literal>Color</tt> to convert, in the 
range[0.0, 1.0]. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Color value for hue, saturation, and brightness provided. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Converts a specific hue, saturation, and brightness to a <tt CLASS=literal>Color</tt> 
and returns the red, green, and blue values in a composite integer value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.5">RGBtoHSB</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-5.5.1">public static float[] RGBtoHSB (int red, int green, int blue, float[] hsbvalues)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red component of <tt CLASS=literal>Color</tt> 
to convert, in the range[0, 255]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green component of 
<tt CLASS=literal>Color</tt> to convert, in the range[0, 
255]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue component of <tt CLASS=literal>Color</tt> 
to convert, in the range[0, 255]. 

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>hsbvalues</I><br>
<DD>

<P CLASS=para>
Three element array in which to put the result. This 
array is used as the method's return object. If <tt CLASS=literal>null</tt>, a new array 
is allocated. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Hue, saturation, and brightness values for <tt CLASS=literal>Color</tt> 
provided, in elements 0, 1, and 2 (respectively) of the returned array. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Allows you to convert specific red, green, blue value to the hue, saturation, 
and brightness equivalent. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.1">brighter</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.1.1">public Color brighter()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Brighter version of current color. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Creates new <tt CLASS=literal>Color</tt> that is somewhat 
brighter than current. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.2">darker</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.2.1">public Color darker()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Darker version of current color. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Creates new <tt CLASS=literal>Color</tt> that is somewhat 
darker than current. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.3">equals</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.3.1">public boolean equals (Object object)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>object</I><br>
<DD>

<P CLASS=para>
The object to compare. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if <tt CLASS=literal>object</tt> 
represents the same color, <tt CLASS=literal>false</tt> otherwise. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.equals(Object)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Compares two different <tt CLASS=literal>Color</tt> 
instances for equivalence. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.4">getBlue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.4.1">public int getBlue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Blue component of current color. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.5">getGreen</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.5.1">public int getGreen()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Green component of current color. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.6">getRed</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.6.1">public int getRed()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Red component of current color. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.7">getRGB</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.7.1">public int getRGB()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Current color as a composite value. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets integer value of current color. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.8">hashCode</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.8.1">public int hashCode()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A hashcode to use when storing <tt CLASS=literal>Color</tt> 
in a <tt CLASS=literal>Hashtable</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.hashCode()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Generates a hashcode for the <tt CLASS=literal>Color</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.9">toString</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-6.9.1">public String toString()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A string representation of the <tt CLASS=literal>Color</tt> object. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.toString()</tt> </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="JAWT-CH-19-REF-COLOR-SECT-7">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Object</tt>, <tt CLASS=literal>Properties</tt>, 
<tt CLASS=literal>Serializable</tt>, <tt CLASS=literal>String</tt> 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch19_13.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top>&nbsp;</td>
<td width=172 align=right valign=top><A HREF="ch19_15.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Choice</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>&nbsp;</td>
<td width=172 align=right valign=top>Component</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
